<table width="100%" border="1" cellspacing="5" cellpadding="5" class="tbl_border">
  <tr>
    <td bgcolor="#3399FF"><!--form id="form2" name="form1" method="post" action="index.php?page=item_filter&&cattegory"><select name="filter_cat" id="filter_cat">
        </?php
        $filter_cat = $_GET['filter_cat'];
		if(isset($filter_cat)){
			if($_GET['filter_cat'] == 'all'){
		?>
        <option value="all" selected="selected">All</option>
        <option value="duration">Duration</option>
        <option value="consumable">Consumable</option>
        </?php
			}elseif($_GET['filter_cat'] == 'duration'){
		?>
        <option value="all" >All</option>
        <option value="duration" selected="selected">Duration</option>
        <option value="consumable">Consumable</option>
        </?php
			}elseif($_GET['filter_cat'] == 'head'){
		?>
        <option value="all" >All</option>
        <option value="duration" >Duration</option>
        <option value="consumable" selected="selected">Consumable</option>
          </?php
			}
		}else{
		?>
        <option value="all">All</option>
        <option value="duration">duration</option>
        <option value="consumable" >consumable</option>
        </?php
		}
		?>
      </select>
      <input type="submit" name="button4" id="button4" value="Filter" />
    </form--></td>
    <td width="23%" align="center" bgcolor="#3399FF"><a href="index.php?page=add_item&&type=pilih"><img src="assets/image/add_btn.png" width="50" height="51" alt="Add" /></a></td>
  </tr>
  <tr>
    <td align="center" bgcolor="#3399FF"><!--a href="index.php?page=item_filter&amp;gcash">G-Cash</a> | <a href="index.php?page=item_filter&amp;point">Point</a--></td>
    <td align="center" bgcolor="#3399FF"><!--form name="form1" method="post" action="index.php?page=item_filter&amp;&amp;pencarian">
      <input type="text" name="search" id="search">
      <input type="submit" name="button" id="button" value="Search">
    </form--></td>
  </tr>
  <tr>
    <td colspan="2"><table width="100%" border="1" cellspacing="4" cellpadding="4" class="tbl_border">
      <tr>
        <td width="3%" align="center" bgcolor="#333333" class="judul">#</td>
        <td width="17%" align="center" bgcolor="#333333" class="judul">Picture</td>
        <td width="12%" align="center" bgcolor="#333333"><a href="index.php?page=item_filter&&sharingan=item_name&&opsi=asc">Item Name</a></td>
        <td width="5%" align="center" bgcolor="#333333"><a href="index.php?page=item_filter&&sharingan=tipe&&opsi=asc">Tipe</a></td>
        <td width="10%" align="center" bgcolor="#333333"><a href="index.php?page=item_filter&&sharingan=cattegory&&opsi=asc">Cattegory</a></td>
        <td width="5%" align="center" bgcolor="#333333"><a href="index.php?page=item_filter&&sharingan=mark&&opsi=asc">Mark</td>
        <td width="13%" align="center" bgcolor="#333333" class="judul">Duration &amp; Price</td>
        <td width="21%" align="center" bgcolor="#333333"><a href="index.php?page=item_filter&&sharingan=damage&&opsi=asc">Description</a></td>
        <td width="5%" align="center" bgcolor="#333333"><a href="index.php?page=item_filter&&sharingan=status&&opsi=asc">Status</a></td>
        <td width="9%" align="center" bgcolor="#333333" class="judul">Config</td>
      </tr><?php
$kueri_dur = mysql_query("select * from tbl_item_duration ORDER BY item_name ASC");
$kueri_con = mysql_query("select * from tbl_item_consumable ORDER BY item_name ASC");
$kueri_row_1 = mysql_num_rows($kueri_dur);
$kueri_row_2 = mysql_num_rows($kueri_con);
//echo $kueri_row;
	$no=0;
	$setrip = "&nbsp;-&nbsp;";
	while($data = mysql_fetch_array($kueri_dur))
	{
		$no++;
		if($no%2){
			$pelangi = "class=\"ganjil\"";	
		}else{
			$pelangi = "class=\"genap\"";	
	}
	?>
		<tr <?=$pelangi;?>>
		  <td align="center"><?=$no;?></td>
		  <td align="center">
		  <?php
		  if($data['id_item'] == NULL){
			echo $setrip;  
		  }else{
		  ?>
		  <!--a href="index.php?page=edit_item&&id=<//?=$data['id_item'];?>"-->
		  <img alt="Picture" width="160px" src="assets/picture/<?=$data['picture'];?>" />
		  <!--/a-->
		  <?php
		  }
		  ?>
		  </td>
		  <td class="judul" align="center"><font color="#FF0000"><?=$data['item_name'];?></font></td>
          <td class="judul" align="center">
		  <?php
		  if($data['tipe'] == 'gcash'){
			echo "G-Cash";  
		  }elseif($data['tipe'] == 'point'){
			  echo "Point"; 
		  }
		  ?></td>
		  <td align="center">
          <?php
		  if($data['cattegory'] == 'duration'){
			echo "Duration";  
		  }elseif($data['cattegory'] == 'consumable'){
			  echo "Consumable"; 
		  }
		  ?>
          </td>
		  <td align="center">
		  <?php
		  if($data['mark'] == "hot"){
			echo "HOT";  
		  }elseif($data['mark'] == "new"){
			echo "NEW";  
		  }elseif($data['mark'] == "regular"){
			echo "REGULAR";  
		  }else{
			echo"ERROR";  
		  }	
		  ?>
		  </td>
		  <td align="center">
		  <?php
		  if($data['tipe'] == 'gcash'){
			    echo "1 Day : $data[gcash1] Gcash <br />3 Day : $data[gcash3] Gcash <br />7 Day : $data[gcash7] Gcash <br />30 Day : $data[gcash30] Gcash";
		  }elseif($data['tipe'] == 'point'){
			    echo "1 Day : $data[point1] Point <br />3 Day : $data[point3] Point <br />7 Day : $data[point7] Point <br />30 Day : $data[point30] Point";
		  }
		  ?></td>
		  <td align="center"><?=$data['description'];?></td>
		  <td align="center">
		  <?php
		  if($data['status'] == "sell"){
			echo "SELL";  
		  }elseif($data['status'] == "not_sell"){
			echo "NOT SELL";  
		  }else{
			echo"ERROR";  
		  }	
		  ?>
		  </td>
		  <td align="center"><!--a href="index.php?page=edit_item&&id=<//?=$data['id_item'];?>">Edit</a><br /--><a href="delete_item.php?id=<?=$data['id_item']; ?>&&cat=<?=$data['cattegory'];?>">Delete</a></td>
		</tr>
<?php
}
?>
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
<?php
while($data2 = mysql_fetch_array($kueri_con))
	{
		$no++;
		if($no%2){
			$pelangi = "class=\"ganjil\"";	
		}else{
			$pelangi = "class=\"genap\"";	
		}
	?>
		<tr <?=$pelangi;?>>
		  <td align="center"><?=$no;?></td>
		  <td align="center">
		  <?php
		  if($data2['id_item'] == NULL){
			echo $setrip;  
		  }else{
		  ?>
		  <!--a href="index.php?page=edit_item&&id=<//?=$data2['id_item'];?>"-->
		  <img alt="Picture" width="160px" src="assets/picture/<?=$data2['picture'];?>" />
		  <!--/a-->
		  <?php
		  }
		  ?>
		  </td>
		  <td class="judul" align="center"><font color="#FF0000"><?=$data2['item_name'];?></font></td>
          <td class="judul" align="center">
		  <?php
		  if($data2['tipe'] == 'gcash'){
			echo "G-Cash";  
		  }elseif($data2['tipe'] == 'point'){
			  echo "Point"; 
		  }
		  ?></td>
		  <td align="center">
          <?php
		  if($data2['cattegory'] == 'duration'){
			echo "Duration";  
		  }elseif($data2['cattegory'] == 'consumable'){
			  echo "Consumable"; 
		  }
		  ?>
          </td>
		  <td align="center">
		  <?php
		  if($data2['mark'] == "hot"){
			echo "HOT";  
		  }elseif($data2['mark'] == "new"){
			echo "NEW";  
		  }elseif($data2['mark'] == "regular"){
			echo "REGULAR";  
		  }else{
			echo"ERROR";  
		  }	
		  ?>
		  </td>
		  <td align="center">
		  <?php
		  if($data2['tipe'] == 'gcash'){
		  	if($data2['unit_1'] == 0 and $data2['cash_price_1'] == 0){
			}else{
				echo "$data2[unit_1] Unit : $data2[cash_price_1] Gcash";
			}
			echo"<br>";
			if($data2['unit_2'] == 0 and $data2['cash_price_2'] == 0){
			}else{
				echo "$data2[unit_2] Unit : $data2[cash_price_2] Gcash";
			}
			    //echo "$data2[unit_1] Unit <br />3 Day : $data[three_day] <br />7 Day : $data[seven_day] <br />30 Day : $data[thirty_day]";
		  }elseif($data2['tipe'] == 'point'){
		  	if($data2['unit_1'] == 0 and $data2['point_price_1'] == 0){
			}else{
				echo "$data2[unit_1] Unit : $data2[point_price_1] Gcash";
			}
			echo"<br>";
			if($data2['unit_2'] == 0 and $data2['point_price_2'] == 0){
			}else{
				echo "$data2[unit_2] Unit : $data2[point_price_2] Gcash";
			}
		  }
		  ?></td>
		  <td align="center"><?=$data2['description'];?></td>
		  <td align="center">
		  <?php
		  if($data2['status'] == "sell"){
			echo "SELL";  
		  }elseif($data2['status'] == "not_sell"){
			echo "NOT SELL";  
		  }else{
			echo"ERROR";  
		  }	
		  ?>
		  </td>
		  <td align="center"><!--a href="index.php?page=edit_item&&id=<//?=$data['id_item'];?>">Edit</a><br /--><a href="delete_item.php?id=<?=$data2['id_item']; ?>&&cat=<?=$data2['cattegory'];?>">Delete</a></td>
		</tr>
		<?php
	}
	?>
    </table></td>
  </tr>
</table>
